local random = math.random

local function isArrayTable(t)  
  if type(t) ~= "table" then  
    return false  
  end  

  local n = #t  
  for i,v in pairs(t) do  
    if type(i) ~= "number" then  
      return false  
    end  

    if i > n then  
      return false  
    end   
  end  

  return true   
end  

return function(t)
  if not isArrayTable(t) then
    return false
  end
  
  local cnt = #t;
  
  while(cnt > 0)
  do
    local i = random(1,cnt);
    t[i], t[cnt] = t[cnt], t[i];
    cnt = cnt - 1;
  end
  
  return true;
end